package com.atguigu.petstore.pets.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 宠物-信息
 * @TableName pets_info
 */
@TableName(value ="pets_info")
@Data
public class PetsInfo implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 宠物图片
     */
    @TableField(value = "pet_img")
    private String petImg;

    /**
     * 宠物名字
     */
    @TableField(value = "pet_name")
    private String petName;

    /**
     * 宠物品种id
     */
    @TableField(value = "pet_type_id")
    private Long petTypeId;

    /**
     * 宠物性别： M：男  F：女
     */
    @TableField(value = "pet_gender")
    private String petGender;

    /**
     * 宠物生日
     */
    @TableField(value = "pet_birth")
    private Date petBirth;

    /**
     * 宠物毛色
     */
    @TableField(value = "pet_color")
    private String petColor;

    /**
     * 宠物标签集合
     */
    @TableField(value = "pet_tag_ids")
    private String petTagIds;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PetsInfo other = (PetsInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPetImg() == null ? other.getPetImg() == null : this.getPetImg().equals(other.getPetImg()))
            && (this.getPetName() == null ? other.getPetName() == null : this.getPetName().equals(other.getPetName()))
            && (this.getPetTypeId() == null ? other.getPetTypeId() == null : this.getPetTypeId().equals(other.getPetTypeId()))
            && (this.getPetGender() == null ? other.getPetGender() == null : this.getPetGender().equals(other.getPetGender()))
            && (this.getPetBirth() == null ? other.getPetBirth() == null : this.getPetBirth().equals(other.getPetBirth()))
            && (this.getPetColor() == null ? other.getPetColor() == null : this.getPetColor().equals(other.getPetColor()))
            && (this.getPetTagIds() == null ? other.getPetTagIds() == null : this.getPetTagIds().equals(other.getPetTagIds()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPetImg() == null) ? 0 : getPetImg().hashCode());
        result = prime * result + ((getPetName() == null) ? 0 : getPetName().hashCode());
        result = prime * result + ((getPetTypeId() == null) ? 0 : getPetTypeId().hashCode());
        result = prime * result + ((getPetGender() == null) ? 0 : getPetGender().hashCode());
        result = prime * result + ((getPetBirth() == null) ? 0 : getPetBirth().hashCode());
        result = prime * result + ((getPetColor() == null) ? 0 : getPetColor().hashCode());
        result = prime * result + ((getPetTagIds() == null) ? 0 : getPetTagIds().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", petImg=").append(petImg);
        sb.append(", petName=").append(petName);
        sb.append(", petTypeId=").append(petTypeId);
        sb.append(", petGender=").append(petGender);
        sb.append(", petBirth=").append(petBirth);
        sb.append(", petColor=").append(petColor);
        sb.append(", petTagIds=").append(petTagIds);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}